package no.sachmuld.methodcombination.examples.reflection.fragilebaseclass;

import java.util.Collection;
import java.util.HashSet;

/**
 *
 */
public class InstrumentedHashSet<E> extends HashSet<E> {

    private int addCount = 0;

    @Override
    public boolean add(E o) {
        addCount++;
        return super.add(o);
    }

    @Override
    public boolean addAll(Collection<? extends E> c) {
        addCount += c.size();
        return super.addAll(c);
    }

    public int getAddCount() {
        return addCount;
    }
}
